package com.association.management.common.utils;

import com.association.management.common.ResultVO;

/**
 * Created by PanD
 */

public class ResultVOUtil {

    public static ResultVO success(Object object) {
        ResultVO resultVo = new ResultVO();
        resultVo.setCode(0);
        resultVo.setMessage("成功");
        resultVo.setData(object);
        return resultVo;
    }

    public static ResultVO success() {
        return success(null);
    }

    public static ResultVO success(String message) {
        ResultVO resultVo = new ResultVO();
        resultVo.setCode(0);
        return resultVo;
    }

    public static ResultVO error(Integer code, String message) {
        ResultVO resultVo = new ResultVO();
        resultVo.setCode(code);
        resultVo.setData(message);
        return resultVo;
    }
}
